import weka.classifiers.Classifier;
import weka.core.Instances;


public class AgentTermChicken extends Agent
{
	private AgentTerminator terminator;
	private AgentChicken chicken;
	
	private boolean aggro;
	private int counter;
	
	public AgentTermChicken(CardDeck deck, int msConstruct, int msPerMove,
			int msLearn)
	{
		super(deck, msConstruct, msPerMove, msLearn);
		
		terminator = new AgentTerminator(deck, msConstruct, msPerMove, msLearn);
		chicken = new AgentChicken(deck, msConstruct, msPerMove, msLearn);
		
		aggro = true;
		counter = 0;
	}

	@Override
	public void startGame(int noThisAgent, StateBattle stateBattle)
	{
		terminator.startGame(noThisAgent, stateBattle);
		chicken.startGame(noThisAgent, stateBattle);
	}

	@Override
	public void endGame(StateBattle stateBattle, double[] results)
	{
		// TODO Auto-generated method stub
		
	}

	@Override
	public Card act(StateBattle stateBattle)
	{
		if(aggro)
		{
			counter++;
			
			if(counter > 2)
			{
				aggro = false;
				counter = 0;
			}
			
			return terminator.act(stateBattle);
		}

		counter++;
		
		if(counter > 2)
		{
			aggro = true;
			counter = 0;
		}
		
		return chicken.act(stateBattle);
	}

	@Override
	public Classifier learn(Instances instances)
	{
		// TODO Auto-generated method stub
		return null;
	}

}
